<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	
		<title><?php echo C('WEB_TITLE');?></title>
	
	<link rel="stylesheet" type="text/css" href="../Public/css/base.css" media="all">
	<link rel="stylesheet" type="text/css" href="../Public/css/module.css">
	<link rel="stylesheet" type="text/css" href="../Public/css/style.css" media="all">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/artDialog/skins/default.css">
	<script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/artDialog/jquery.artDialog.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/artDialog/artDialog.plugins.min.js"></script>
	<script type="text/javascript" src="../Public/js/common.js"></script>
	<?php if(in_array((ACTION_NAME), explode(',',"add,edit"))): ?><script type="text/javascript" src="__PUBLIC__/Js/ValidForm.js"></script><?php endif; ?>
	
	<script type="text/javascript">
        var URL	   ='__URL__';
        var PUBLIC = "../Public/";
    </script>
</head>
<body style="padding:0;">
	
	<div id="main-content">
		<div id="top-alert" class="fixed alert alert-error" style="display: none;">
			<button class="close fixed" style="margin-top: 4px;">&times;</button>
			<div class="alert-content">这是内容</div>
		</div>
		<div id="main" class="main">
			
	<div class="main-title">
		<h2>SEO优化</h2>
	</div>
	<div class="cf">
		<div class="fl">
			<select onchange="window.location='?s=/Seo/index/module/'+this.value;">
				<?php
 $module=$_GET['module'] ? $_GET['module'] : 'index'; foreach ($list as $k1 => $v1) { foreach ($v1 as $k2 => $v2) { if ($k2=='remark'){continue;} echo '<OPTGROUP label="'.$v2['remark'].'">'; foreach ($v2 as $k3 => $v3) { if ($k3!='remark'){ if ($module==$k3){ echo '<option value="'.$k3.'" selected="selected">'.$v3['remark'].'</option>'; $eachlist=$v3; $curr=$k1.'|'.$k2.'|'.$k3; }else{ echo '<option value="'.$k3.'">'.$v3['remark'].'</option>'; } } } echo '</OPTGROUP>'; } } ?>
			</select>
		</div>
	</div>
	<div class="data-table table-striped">
		<FORM METHOD=POST id="form1" name="form1" action="__URL__/update">
			<div class="list" >
				<table id="checkList" class="list" cellpadding=0 cellspacing=0 >
				<INPUT TYPE="hidden" name="cansnow[remark]" value="<?php echo ($eachlist["remark"]); ?>">		
				<?php
 foreach ($eachlist as $k => $v) { if ($k=='remark'){continue;} ?>
					<tr class="row" >
						<td class="tRight" width="100px;"><?php echo ($v["remark"]); ?></td>
						<td class="tLeft"  >
							<INPUT TYPE="hidden" name="cansnow[<?php echo ($k); ?>][remark]" value="<?php echo ($v["remark"]); ?>">
							<label class="ztitle">　　标题：</label><input type="text" class="text input-large t1" name="cansnow[<?php echo ($k); ?>][title]" value="<?php echo ($v["title"]); ?>"><br>
							<label class="ztitle">　关键字：</label><input type="text" class="text input-large t2" name="cansnow[<?php echo ($k); ?>][keyword]" value="<?php echo ($v["keyword"]); ?>"><br>
							<label class="ztitle">页面描述：</label><input type="text" class="text input-large t3" name="cansnow[<?php echo ($k); ?>][description]" value="<?php echo ($v["description"]); ?>"><br>					
						</td>
					</tr>
				<?php	 } ?>
				</table>
			</div>
			<div class="page" style="text-align:center;">
				<INPUT TYPE="hidden" name="curr" value="<?php echo ($curr); ?>">
			<div class="imgbtndiv" ><input type="submit" id="" name="sort" value="保 存" onclick="" class="sort imgButton"></div>
			</div>
		</FORM>
	</div>

		</div>
		<!-- <div class="cont-ft">
			<div class="copyright">
				<div class="fl">感谢使用<a href="http://www.onethink.cn" target="_blank">OneThink</a>管理平台</div>
				<div class="fr">V1.0.131129</div>
			</div>
		</div> -->
	</div>
	<script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();
            $("#subnav h3 a").click(function(e){e.stopPropagation()});
	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });
            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
		//搜索功能
		$("#search").click(function(){
			var url = $(this).attr('url');
	        var query  = $('.search-form').find('input').serialize();
	        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
	        query = query.replace(/^&/g,'');
	        if( url.indexOf('?')>0 ){
	            url += '&' + query;
	        }else{
	            url += '?' + query;
	        }
			window.location.href = url;
		});
		//回车搜索
		$(".search-input").keyup(function(e){
			if(e.keyCode === 13){
				$("#search").click();
				return false;
			}
		});
		$(function(){
			$('.row td:gt(0)').attr('nowrap','');
			$('.row th:gt(0)').attr('nowrap','');
			$('.row:gt(0)').click(function(e){
				if(e.target.name!='key'){
					// && !e.target.href
					var xx=$(this).find(':checkbox');
					xx.attr('checked',!xx.attr('checked'));
				}
			});
			$('.Abstruct').each(function(){
				if ($(this).attr('type')=='img'){
					var src=$(this).html();
					$(this).click(function(){
						$.dialog({ 
							title:'查看图片',
							content: src+'<br><img src="'+src+'" />'
						}); 
					});
				}else{
					var src=$(this).html();
					$(this).click(function(){
						$.dialog({ 
							title:'查看详细',
							content: eval(src)
						}); 
					});
				}
				$(this).attr('title',$(this).html());
			});

		})
	</script>
	
<script type="text/javascript">
	<!--
		var xx=0;
		function insert(str){
			var obj = $(".bLeft:eq("+xx+")").get(0);
			if (document.selection) {
				obj.focus();
				var sel = document.selection.createRange();
				sel.text = str;
			} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
			} else {
				obj.value += str;
			}
			//$(".bLeft:eq("+xx+")").val($(".bLeft:eq("+xx+")").val()+str);
			$(".bLeft:eq("+xx+")").focus();
		}
		$('.bLeft').blur(function(){
			xx=$('.bLeft').index($(this));
		});
		$(function () {
			$('.t1').after('&nbsp;<a class="kj">页面标题</a>&nbsp; | &nbsp;<a class="kj">全局标题</a>');
			$('.t2').after('&nbsp;<a class="kj">页面关键字</a>|&nbsp; <a class="kj">全局关键字</a>');
			$('.t3').after('&nbsp;<a class="kj">页面描述</a>&nbsp;|&nbsp; <a class="kj">全局描述</a>');
			$('.kj').attr('href','javascript:void(0);');
			$('.kj').click(function(){
				xx=$('.bLeft').index($(this).prevAll('.bLeft'));
				insert('{'+$(this).html()+'}');
			});
		});
	//-->
</script>

</body>
</html>